package com.m4f.city.business.domain;

import java.util.List;

import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.m4f.city.business.domain.ifc.IModelDomain;
import com.m4f.city.utils.serializer.annotation.M4FPropertySerializable;
import com.m4f.city.utils.serializer.annotation.M4FSerializable;

@M4FSerializable(name = "organization")
@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class Organization implements IModelDomain {
	@PrimaryKey  
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@M4FPropertySerializable(name="id")
	private Long id;
	
	@Persistent
	@M4FPropertySerializable(name="cif")
	private String cif;
	
	@Persistent
	@M4FPropertySerializable(name="name")
	private String name;
	
	@Persistent
	@M4FPropertySerializable(name="domain")
	private String domain;
	
	// TODO LOGO
	
	@Persistent(defaultFetchGroup="true")
	@Embedded
	private ContactInfo contactInfo;

	@Persistent
	@M4FPropertySerializable(name="applications")
	private List<Long> applicationIds;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCif() {
		return cif;
	}

	public void setCif(String cif) {
		this.cif = cif;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDomain() {
		return domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	public ContactInfo getContactInfo() {
		return contactInfo;
	}

	public void setContactInfo(ContactInfo contactInfo) {
		this.contactInfo = contactInfo;
	}

	public List<Long> getApplicationIds() {
		return this.applicationIds;
	}

	public void setApplicationIds(List<Long> applicationIds) {
		this.applicationIds = applicationIds;
	}
}
